/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef GEN_OPTICAL_MODULE_DIAGNOSE_INTERFACE_H
#define GEN_OPTICAL_MODULE_DIAGNOSE_INTERFACE_H

#include <device_tree/base.h>

namespace dev::gen {

class MC_API OpticalModule_Diagnose : public mc::engine::interface<OpticalModule_Diagnose> {
public:
    MC_INTERFACE("bmc.dev.OpticalModule.Diagnose")

    property<uint8_t>  RXLossOfLock;              ///< 接受方向的CDR失败状态
    property<uint8_t>  TXLossOfLock;              ///< 发送方向的CDR失败状态
    property<uint32_t> LaserRuntimeSeconds;       ///< 激光器运行时间
    property<double>   LaserTemperatureCelsius;   ///< 激光器管芯温度
    property<uint16_t> PowerOnCount;              ///< 模块上电次数
    property<uint32_t> UptimeSeconds;             ///< 模块上电时间
    property<uint16_t> PowerStatus;               ///< 模块上电状态
    property<double>   OdspDieTemperatureCelsius; ///< ODSP结温
    property<uint32_t> OdspHighTempRuntimeSeconds; ///< ODSP高温运行时间
    property<uint64_t> SelfTestStatus;            ///< 光模块自体诊断告警状态
    property<uint16_t> MediaInterfaceFaultStatus; ///< 光链路告警状态
    property<uint16_t> HostInterfaceFaultStatus;  ///< 电链路告警状态
    property<uint32_t> RXLoS;                     ///< 接收端LoS
    property<uint32_t> TXLoS;                     ///< 发送端LoS
    property<uint32_t> TXFault;                   ///< 发送错误
    property<bool>     PRBSTestSupported;         ///< 是否支持PRBS压测
};
} // namespace dev::gen

#endif // GEN_OPTICAL_MODULE_DIAGNOSE_INTERFACE_H
